﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="QuanLyMoiGioi.aspx.cs" Inherits="Admin_QuanLyMoiGioi" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<h3>Danh sách môi giới ngân hàng</h3>

    <asp:ListView ID="ListView1" runat="server" DataKeyNames="ma" 
        DataSourceID="SqlDataSource1" EnableModelValidation="True" 
        InsertItemPosition="LastItem">
        <AlternatingItemTemplate>
            <tr style="">
                <td>
                    <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" 
                        Text="Delete" />
                    <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                </td>
                <td>
                    <asp:Label ID="maLabel" runat="server" Text='<%# Eval("ma") %>' />
                </td>
                <td>
                    <asp:Label ID="ten_wsLabel" runat="server" Text='<%# Eval("ten_ws") %>' />
                </td>
                <td>
                    <asp:Label ID="service_nameLabel" runat="server" 
                        Text='<%# Eval("service_name") %>' />
                </td>
                <td>
                    <asp:Label ID="user_nameLabel" runat="server" Text='<%# Eval("user_name") %>' />
                </td>
                <td>
                    <asp:Label ID="linkLabel" runat="server" Text='<%# Eval("link") %>' />
                </td>
                <td>
                    <asp:Label ID="passLabel" runat="server" Text='<%# Eval("pass") %>' />
                </td>
            </tr>
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <tr style="">
                <td>
                    <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                        Text="Update" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Cancel" />
                </td>
                <td>
                    <asp:Label ID="maLabel1" runat="server" Text='<%# Eval("ma") %>' />
                </td>
                <td>
                    <asp:TextBox ID="ten_wsTextBox" runat="server" Text='<%# Bind("ten_ws") %>' />
                </td>
                <td>
                    <asp:TextBox ID="service_nameTextBox" runat="server" 
                        Text='<%# Bind("service_name") %>' />
                </td>
                <td>
                    <asp:TextBox ID="user_nameTextBox" runat="server" 
                        Text='<%# Bind("user_name") %>' />
                </td>
                <td>
                    <asp:TextBox ID="linkTextBox" runat="server" Text='<%# Bind("link") %>' />
                </td>
                <td>
                    <asp:TextBox ID="passTextBox" runat="server" Text='<%# Bind("pass") %>' />
                </td>
            </tr>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <table runat="server" style="">
                <tr>
                    <td>
                        No data was returned.</td>
                </tr>
            </table>
        </EmptyDataTemplate>
        <InsertItemTemplate>
            <tr style="">
                <td>
                    <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                        Text="Insert" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Clear" />
                </td>
                <td>
                    <asp:TextBox ID="maTextBox" runat="server" Text='<%# Bind("ma") %>' />
                </td>
                <td>
                    <asp:TextBox ID="ten_wsTextBox" runat="server" Text='<%# Bind("ten_ws") %>' />
                </td>
                <td>
                    <asp:TextBox ID="service_nameTextBox" runat="server" 
                        Text='<%# Bind("service_name") %>' />
                </td>
                <td>
                    <asp:TextBox ID="user_nameTextBox" runat="server" 
                        Text='<%# Bind("user_name") %>' />
                </td>
                <td>
                    <asp:TextBox ID="linkTextBox" runat="server" Text='<%# Bind("link") %>' />
                </td>
                <td>
                    <asp:TextBox ID="passTextBox" runat="server" Text='<%# Bind("pass") %>' />
                </td>
            </tr>
        </InsertItemTemplate>
        <ItemTemplate>
            <tr style="">
                <td>
                    <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" 
                        Text="Delete" />
                    <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                </td>
                <td>
                    <asp:Label ID="maLabel" runat="server" Text='<%# Eval("ma") %>' />
                </td>
                <td>
                    <asp:Label ID="ten_wsLabel" runat="server" Text='<%# Eval("ten_ws") %>' />
                </td>
                <td>
                    <asp:Label ID="service_nameLabel" runat="server" 
                        Text='<%# Eval("service_name") %>' />
                </td>
                <td>
                    <asp:Label ID="user_nameLabel" runat="server" Text='<%# Eval("user_name") %>' />
                </td>
                <td>
                    <asp:Label ID="linkLabel" runat="server" Text='<%# Eval("link") %>' />
                </td>
                <td>
                    <asp:Label ID="passLabel" runat="server" Text='<%# Eval("pass") %>' />
                </td>
            </tr>
        </ItemTemplate>
        <LayoutTemplate>
            <table runat="server">
                <tr runat="server">
                    <td runat="server">
                        <table ID="itemPlaceholderContainer" runat="server" border="0" style="">
                            <tr runat="server" style="">
                                <th runat="server">
                                </th>
                                <th runat="server">
                                    ma</th>
                                <th runat="server">
                                    ten_ws</th>
                                <th runat="server">
                                    service_name</th>
                                <th runat="server">
                                    user_name</th>
                                <th runat="server">
                                    link</th>
                                <th runat="server">
                                    pass</th>
                            </tr>
                            <tr ID="itemPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr runat="server">
                    <td runat="server" style="">
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
        <SelectedItemTemplate>
            <tr style="">
                <td>
                    <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" 
                        Text="Delete" />
                    <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                </td>
                <td>
                    <asp:Label ID="maLabel" runat="server" Text='<%# Eval("ma") %>' />
                </td>
                <td>
                    <asp:Label ID="ten_wsLabel" runat="server" Text='<%# Eval("ten_ws") %>' />
                </td>
                <td>
                    <asp:Label ID="service_nameLabel" runat="server" 
                        Text='<%# Eval("service_name") %>' />
                </td>
                <td>
                    <asp:Label ID="user_nameLabel" runat="server" Text='<%# Eval("user_name") %>' />
                </td>
                <td>
                    <asp:Label ID="linkLabel" runat="server" Text='<%# Eval("link") %>' />
                </td>
                <td>
                    <asp:Label ID="passLabel" runat="server" Text='<%# Eval("pass") %>' />
                </td>
            </tr>
        </SelectedItemTemplate>
    </asp:ListView>
    
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConflictDetection="CompareAllValues" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        DeleteCommand="DELETE FROM [MoiGioiNganHang] WHERE [ma] = @original_ma AND (([ten_ws] = @original_ten_ws) OR ([ten_ws] IS NULL AND @original_ten_ws IS NULL)) AND (([service_name] = @original_service_name) OR ([service_name] IS NULL AND @original_service_name IS NULL)) AND (([user_name] = @original_user_name) OR ([user_name] IS NULL AND @original_user_name IS NULL)) AND (([link] = @original_link) OR ([link] IS NULL AND @original_link IS NULL)) AND (([pass] = @original_pass) OR ([pass] IS NULL AND @original_pass IS NULL))" 
        InsertCommand="INSERT INTO [MoiGioiNganHang] ([ma], [ten_ws], [service_name], [user_name], [link], [pass]) VALUES (@ma, @ten_ws, @service_name, @user_name, @link, @pass)" 
        OldValuesParameterFormatString="original_{0}" 
        SelectCommand="SELECT [ma], [ten_ws], [service_name], [user_name], [link], [pass] FROM [MoiGioiNganHang]" 
        UpdateCommand="UPDATE [MoiGioiNganHang] SET [ten_ws] = @ten_ws, [service_name] = @service_name, [user_name] = @user_name, [link] = @link, [pass] = @pass WHERE [ma] = @original_ma AND (([ten_ws] = @original_ten_ws) OR ([ten_ws] IS NULL AND @original_ten_ws IS NULL)) AND (([service_name] = @original_service_name) OR ([service_name] IS NULL AND @original_service_name IS NULL)) AND (([user_name] = @original_user_name) OR ([user_name] IS NULL AND @original_user_name IS NULL)) AND (([link] = @original_link) OR ([link] IS NULL AND @original_link IS NULL)) AND (([pass] = @original_pass) OR ([pass] IS NULL AND @original_pass IS NULL))">
        <DeleteParameters>
            <asp:Parameter Name="original_ma" Type="String" />
            <asp:Parameter Name="original_ten_ws" Type="String" />
            <asp:Parameter Name="original_service_name" Type="String" />
            <asp:Parameter Name="original_user_name" Type="String" />
            <asp:Parameter Name="original_link" Type="String" />
            <asp:Parameter Name="original_pass" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="ma" Type="String" />
            <asp:Parameter Name="ten_ws" Type="String" />
            <asp:Parameter Name="service_name" Type="String" />
            <asp:Parameter Name="user_name" Type="String" />
            <asp:Parameter Name="link" Type="String" />
            <asp:Parameter Name="pass" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="ten_ws" Type="String" />
            <asp:Parameter Name="service_name" Type="String" />
            <asp:Parameter Name="user_name" Type="String" />
            <asp:Parameter Name="link" Type="String" />
            <asp:Parameter Name="pass" Type="String" />
            <asp:Parameter Name="original_ma" Type="String" />
            <asp:Parameter Name="original_ten_ws" Type="String" />
            <asp:Parameter Name="original_service_name" Type="String" />
            <asp:Parameter Name="original_user_name" Type="String" />
            <asp:Parameter Name="original_link" Type="String" />
            <asp:Parameter Name="original_pass" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
</asp:Content>

